<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>我的试驾</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="stylesheet" href="sign_up.css">
        <link rel="stylesheet" href="normalize.css">
        <link rel="stylesheet" href="../public_css/public_header.css">
    </head>
    <body>
        <header class=" public_header">
            <div class="public_header_return">
                <img src="../public_img/return.png" alt="" class="public_header_return" onclick="history.back(-1)">
                <p>驾校详情</p>
            </div>
        </header>

        <section class="site_look">
            <img class="qw" src="site.png" >
        </section>
        <section class="main_info_module">
            <section class="school_address">
                <img src="click_to_check.png" class="address" alt="点击查看">
                <h2 id="school_name">加载中..</h2>
                <p id="school_address">驾校地址:加载中..</p>
            </section>
            <section class="link_man">
                <img id="tell" src="signed&refer.png" alt="报名咨询">
                <h2>报名联系人:<span id="school_man">加载中..</span></h2>
                <p id="man_phone">联系电话:加载中..</p>
            </section>
            <section class="how_to_learn">
                <form  id="chose" class="how_to_fee">
                    <label for="input_learn_1">
                        计时学车<input id="input_learn_1" type="radio" name="sign_type" value="rntime" checked disabled /><i></i>
                    </label>

                </form>
                <section class="material">
                    <h2>所需材料:</h2>
                    <p>居住证明(外地户口)<span>x1</span>
                    </p>
                    <p>一寸白底照片6张<span>x1</span>
                    </p>
                    <p>照相馆拍照上传回执单<span>x1</span>
                    </p>
                    <p>本人身份证复印件<span>x1</span>
                    </p>
                    <p>体检合格报告<span>x1</span>
                    </p>
                    <div class="price">
                        <p id="school_place">加载中...</p>
                    </div>
                </section>
                <form class="server_final">
                    <label for="checked1">
                        <input id ="checked1" type="checkbox" name="check1" checked/><i></i>随时退
                    </label>
                    <label for="checked2">
                        <input id ="checked2" type="checkbox" name="check2" checked/><i></i>免预约
                    </label>
                    <label for="checked3">
                        <input id ="checked3" type="checkbox" name="check3" checked/><i></i>接送服务
                    </label>
                </form>
            </section>
            <section class="footer_submit">
                <form>
                    <input type="button" value="立即报名">
                </form>
            </section>
        </section>
        <script src="../info/jquery.min.js"></script>
        <script src="index.js"></script>
        <script src="picturefill.js"></script>
        <script src="../layer.js"></script>
        <script>
            $(".address").click(function(){
                window.location.href="../address/distence.html";
            });
            $(function () {
                var token =localStorage.phone;
                var school_id =localStorage.school_id;
                $.ajax({
                    url:"https://newapp.icandrive.cn/api/schoolInfo.php",
                    data:{token:token,school_id:school_id},
                    dataType:'json',
                    type:'post',
                    success:function(data){
                        if(data.status){
                            $('#tell').click(function () {
                                window.location.href='tel://'+data.data.school_phone;
                            });
                            localStorage.gps_jj=data.data.gps_j;
                            localStorage.gps_ww=data.data.gps_w;
                            localStorage.school_address=data.data.school_address;
                            localStorage.man_phone= data.data.man_phone;

                            $('#school_name').html(data.data.school_name);
                            $('#school_address').html(data.data.school_address);
                            $('#school_man').html(data.data.school_man);
                            $('#man_phone').html('联系电话:'+data.data.man_phone);
                            if($.trim(data.data.school_place1)!=''){
                                $('#chose').append("<label for='input_learn_2'>一费制<input id='input_learn_2' type='radio' value='one' name='sign_type' disabled /><i></i></label>")
                                $('#school_place').html("<del>￥"+data.data.school_place1+"</del>￥"+data.data.school_place2);
                            }else{
                                $('#school_place').html("￥"+data.data.school_place2);
                            }

                            $('#chose input').prop('disabled',false);
                            $('.qw').prop('src',data.data.school_img2);
                            var place=data.data.school_place2;
                            $("#chose label").click(function () {
                                if($(this).find('input').val()=='one'){
                                    $('#school_place').html("<del>￥"+data.data.school_place2+"</del>￥"+data.data.school_place1);
                                    place=data.data.school_place1;
                                }else{
                                    $('#school_place').html("<del>￥"+data.data.school_place1+"</del>￥"+data.data.school_place2);
                                    place=data.data.school_place2;
                                }
                            });
                            $("input[type='button']").click(function () {

                                localStorage.place=place;
                                var sign_type='';
                                $("input[name='sign_type']").each(function () {
                                    if($(this).prop('checked')){
                                        sign_type=$(this).val();
                                    }
                                });
                                var sign_type_name='一费制';
                                if(sign_type=='rntime'){
                                    sign_type_name='计时学车';
                                }

                                localStorage.sign_type=sign_type;
                                localStorage.sign_type_name = sign_type_name;

                                /*window.location.href='../payment/02/school_pay.html';*/
                                window.location.href='../enlist_button/index.html'
                            })
                        }else{
                            layer.msg("数据获取失败");
                        }
                    },
                    error: function () {
                        layer.msg('系统维护中',function(){
                            history.go(0)
                        },1000);
                    }
                });
            })
        </script>

        <script>
            document.addEventListener("plusready", function() {
                // 注册返回按键事件
                plus.key.addEventListener('backbutton', function() {
                    window.history.back();
                }, false);
                //此处false代表不退出页面，如果为true回退到上一个一面
            });
        </script>
    </body>
</html>
